
import "./App.css"

import { HashRouter, Route, Switch } from "react-router-dom"
import React, { lazy, Suspense } from 'react';

let Admin = lazy(() => import('./views/admin/admin'))
let Login = lazy(() => import('./views/login/login'))

function App() {
  return (
    <div className="App">
      {/* 这是一级路由 */}
      <HashRouter>
        <Suspense fallback={<h1>loading.....</h1>}>
          <Switch>
            <Route path="/login" component={Login}></Route>
            <Route path="/" component={Admin}></Route>
          </Switch>
        </Suspense>
      </HashRouter>
    </div>
  );
}

export default App;
